/**
 * 该js为所有页面都必须加载的js
 * 可以用于全局添加某功能
 */
//import FastClick from "fastclick";
//import VConsole from "vconsole/dist/vconsole.min.js";
//new VConsole();
// 去除300ms延迟
//document.addEventListener(
//"DOMContentLoaded",
//function() {
//  FastClick.attach(document.body);
//},
//false
//);

window.utils = {};
//检查网络
utils.netchangeListener = function() {
	if(plus.networkinfo.getCurrentType() == plus.networkinfo.CONNECTION_NONE) {
		mui.toast("网络异常，请检查网络设置！");
		return true;
	} else {

	}
	return false;
}

document.addEventListener("netchange", utils.netchangeListener, false);

/*进度条*/
utils.showWaiting = function(hintText) {
	var content = "正在加载...";
	if(hintText) content = hintText;
	var wait = plus.nativeUI.showWaiting(content, {
		padding: "26px"
	});
	return wait;
}

/*关闭进度条*/
utils.closeWaiting = function() {
	if(window.plus)
		plus.nativeUI.closeWaiting();
}
